var DoctorLooked = {
    id: "DoctorLookedTable",	//表格id
    seItem: null,		//选中的条目
    table: null,
    layerIndex: -1
};

DoctorLooked.initColumn = function () {//初始化表格的列
    var columns = [
        {field: 'selectItem', radio: true},
        {title: 'customerId', field: 'customerId', visible: false, align: 'center', valign: 'middle'},
        {title: 'isStatus', field: 'isStatus', visible: false, align: 'center', valign: 'middle'},
        {title: 'finishStatus', field: 'finishStatus', visible: false, align: 'center', valign: 'middle'},
        {title: 'transferStatus', field: 'transferStatus', visible: false, align: 'center', valign: 'middle'},
        {title: 'finishStatus', field: 'finishStatus', visible: false, align: 'center', valign: 'middle'},
        {title: 'deductStatus', field: 'deductStatus', visible: false, align: 'center', valign: 'middle'},
        {title: 'reservationsId', field: 'reservationsId', visible: false, align: 'center', valign: 'middle'},
        {title: 'tardyHour', field: 'tardyHour', visible: false, align: 'center', valign: 'middle'},
        {title: '病历号', field: 'medicalRecordNumber', align: 'center', valign: 'middle', width: 120},
        {
            title: '患者姓名', field: 'customerName', align: 'center', valign: 'middle', width: 120,
            formatter: function (value, row, index) {
                if(row.customerAge == "" || row.customerAge == null || row.customerAge == "null"){
                    return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/unkown-sex.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                } else if (row.customerAge >= 0 && row.customerAge < 18) {
                    if (row.customerSex == 1) {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/nan-child.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    } else if (row.customerSex == 2) {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/nv-child.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    } else {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/unkown-sex.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    }
                } else if (row.customerAge >= 18 && row.customerAge <= 50) {
                    if (row.customerSex == 1) {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/male-adult.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    } else if (row.customerSex == 2) {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/lfemale-child.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    } else {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/unkown-sex.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    }
                } else if (row.customerAge > 50) {
                    if (row.customerSex == 1) {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/male-old.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    } else if (row.customerSex == 2) {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/female-old.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    } else {
                        return "<a href='javascript:;' onclick='DoctorLooked.openBilee(" + '"' + row.customerId + '"' + ")' style='display: flex;align-items: center;'><img src='" + Feng.ctxPath + "/static/img/unkown-sex.png' alt='' width='40px'><span class='portraitHeadName'>" + value + "</span></a>"
                    }
                }
            }
        },
        {title: '电话', field: 'customerPhone', align: 'center', valign: 'middle', width: 140},
        {
            title: '性别', field: 'customerSex', align: 'center', valign: 'middle', width: 80,
            formatter: function (value, row, index) {
                if (value == 1) {
                    return "男";
                } else if (value == 2) {
                    return "女";
                } else {
                    return "未知";
                }
            }
        },
        {title: '年龄', field: 'customerAge', align: 'center', valign: 'middle', width: 80},
        {
            title: '预约/挂号', field: 'arrivalTime', align: 'center', valign: 'middle', sortable: true, width: 110,
            formatter: function (value, row, index) {
                return value.substring(11, 16);
            }
        },
        {
            title: '预约时间', field: 'startTime', align: 'center', valign: 'middle', sortable: true, width: 110,
            formatter: function (value, row, index) {
                return value.substring(11, 16);
            }
        },
        {title: '预约类型', field: 'status', align: 'center', valign: 'middle', width: 80},
        {
            title: '医生', field: 'doctor', align: 'center', valign: 'middle', width: 90,
            formatter: function (value, row, index) {
                return '<span title="' + value + '">' + value + '</span>'
            },
            cellStyle: function (value, row, index) {
                return {css: {"overflow": "hidden", "white-space": "nowrap", "text-overflow": "ellipsis"}}
            }
        },
        {title: '客户状态', field: 'customerStatus', align: 'center', valign: 'middle', width: 80,},
        {
            title: '看诊项目', field: 'appointmentPayService', align: 'center', valign: 'middle', width: 100,
            formatter: function (value, row, index) {
                if (row.appointmentPayService == "null" || row.appointmentPayService == "") {
                    return "";
                } else {
                    return '<span title="' + value + '">' + value + '</span>'
                }
            },
            cellStyle: function (value, row, index) {
                return {css: {"overflow": "hidden", "white-space": "nowrap", "text-overflow": "ellipsis"}}
            }
        },
        {
            title: '就诊状态', field: 'arrivalStatus', align: 'center', valign: 'middle', width: 100,
            formatter: function (value, row, index) {
                var strTime = (row.arrivalTime).replace("/-/g", "/");//时间转换
                var pastTime = new Date(strTime);  //时间
                var newTime = new Date();  //现在时间
                if (value == 2) {
                    if (pastTime < newTime) {
                        return "<span>等待" + row.tardyHour + "</span>";
                    } else {
                        return "<span>已挂号</span>";
                    }
                } else if (value == 3) {
                    return "<span>治疗中</span>"
                } else if (value == 4) {
                    return "<span>完成治疗</span>"
                } else if (value == 5) {
                    return "<span>离开</span>"
                } else if (value == 6) {
                    return "<span>已回访</span>"
                } else {
                    if (pastTime < newTime) {
                        return "<span>迟到" + row.tardyHour + "</span>";
                    } else {
                        return "<span>已预约</span>";
                    }
                }
            },
            cellStyle: function (value, row, index) {
                var strTime = (row.arrivalTime).replace("/-/g", "/");//时间转换
                var pastTime = new Date(strTime);  //时间
                var newTime = new Date();  //现在时间
                if (value == 2) {
                    if (pastTime < newTime) {
                        return {
                            css: {
                                "background-color": "#f95a3b",
                                "color": "white",
                                "overflow": "hidden",
                                "white-space": "nowrap",
                                "text-overflow": "ellipsis"
                            }
                        }
                    } else {
                        return {
                            css: {
                                "background-color": "#0d4b98",
                                "color": "white",
                                "overflow": "hidden",
                                "white-space": "nowrap",
                                "text-overflow": "ellipsis"
                            }
                        }
                    }
                } else if (value == 3) {
                    return {
                        css: {
                            "background-color": "#fdc42d",
                            "color": "white",
                            "overflow": "hidden",
                            "white-space": "nowrap",
                            "text-overflow": "ellipsis"
                        }
                    }
                } else if (value == 4) {
                    return {
                        css: {
                            "background-color": "#2cc87e",
                            "color": "white",
                            "overflow": "hidden",
                            "white-space": "nowrap",
                            "text-overflow": "ellipsis"
                        }
                    }
                } else if (value == 5) {
                    return {
                        css: {
                            "background-color": "#a0a0a0",
                            "color": "white",
                            "overflow": "hidden",
                            "white-space": "nowrap",
                            "text-overflow": "ellipsis"
                        }
                    }
                } else {
                    return {}
                }
            }
        },
        {
            title: '备注', field: 'remarks', align: 'center', valign: 'middle', width: 120,
            formatter: function (value, row, index) {
                return '<span title="' + value + '">' + value + '</span>'
            },
            cellStyle: function (value, row, index) {
                return {css: {"overflow": "hidden", "white-space": "nowrap", "text-overflow": "ellipsis"}}
            }
        },
        {
            title: '接诊', field: 'id', align: 'center', valign: 'middle', width: 50,
            formatter: function (value, row, index) {
                if (row.arrivalStatus == 3 || row.arrivalStatus == 4 || row.arrivalStatus == 5) {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.reception(\'' + row.customerId + '\',\'' + row.customerName + '\')"><span class="glyphicon glyphicon-ok" style="color:#ff7e00 "></span></button>';
                } else {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.reception(\'' + row.customerId + '\',\'' + row.customerName + '\')"><span class="glyphicon glyphicon-plus"></span></button>';
                }
            }
        },
        {
            title: '划扣', field: 'id', align: 'center', valign: 'middle', width: 50,
            formatter: function (value, row, index) {
                if (row.deductStatus == 1) {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.charge(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-ok" style="color:#ff7e00 "></span></button>';
                } else {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.charge(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-plus"></span></button>';
                }
            }
        },
        {
            title: '病历', field: 'id', align: 'center', valign: 'middle', width: 50,
            formatter: function (value, row, index) {
                if (row.isStatus == 1) {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.case(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-ok" style="color:#ff7e00 "></span></button>';
                } else {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.case(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-plus"></span></button>';
                }
            }
        },
        {
            title: '随访', field: 'id', align: 'center', valign: 'middle', width: 50,
            formatter: function (value, row, index) {
                if (row.visitStatus == 1) {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.revisit(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-ok" style="color:#ff7e00 "></span></button>';
                } else {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.revisit(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-plus"></span></button>';
                }
            }
        },
        {
            title: '复诊预约', field: 'id', align: 'center', valign: 'middle', width: 80,
            formatter: function (value, row, index) {
                if (row.addStatus == 1) {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.subsequent(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-ok" style="color:#ff7e00 "></span></button>';
                } else {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.subsequent(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-plus" ></span></button>';
                }
            }
        },
        {
            title: '上传影像', field: 'id', align: 'center', valign: 'middle', width: 80,
            formatter: function (value, row, index) {
                if (row.finishStatus == 1) {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.image(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-ok" style="color:#ff7e00 "></span></button>';
                } else {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.image(\'' + row.customerId + '\')"><span class="glyphicon glyphicon-plus"></span></button>';
                }
            }
        },
        {
            title: '治疗完成', field: 'id', align: 'center', valign: 'middle', width: 80,
            formatter: function (value, row, index) {
                if (row.arrivalStatus == 4 || row.arrivalStatus == 5) {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.completion(\'' + row.customerId + '\',\'' + row.customerName + '\')"><span class="glyphicon glyphicon-ok " style="color:#ff7e00 "></span></button>';
                } else {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.completion(\'' + row.customerId + '\',\'' + row.customerName + '\')"><span class="glyphicon glyphicon-plus"></span></button>';
                }
            }
        },
        {
            title: '转诊', field: 'id', align: 'center', valign: 'middle', width: 80,
            formatter: function (value, row, index) {
                if (row.isReferraler == 1) {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.zaizhen(\'' + row.customerId + '\',\'' + row.reservationsId + '\')"><span class="glyphicon glyphicon-ok" style="color:#ff7e00 "></span></button>';
                } else {
                    return '<button type="button" class="btn" style="background: #ffffff;border: 1px solid #cccccc;padding: 1px 4px 0px 5px;" onclick="DoctorLooked.zaizhen(\'' + row.customerId + '\',\'' + row.reservationsId + '\')"><span class="glyphicon glyphicon-plus"></span></button>';
                }
            }
        }
    ];
    return columns;
};

DoctorLooked.openBilee = function (id) {//点击姓名查看详情
    var index = layer.open({
        type: 2,
        title: '患者信息',
        area: ['100%', '100%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/doctor_seeDiagnosis/' + id + '/' + 0
    });
    this.layerIndex = index;
};

DoctorLooked.case = function (id) {//点击病历 客户ID
    var index = layer.open({
        type: 2,
        title: '病历',
        area: ['100%', '100%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/case_info/' + id
    });
    this.layerIndex = index;
};

DoctorLooked.reception = function (customerId, customerName) {//点击接诊 客户ID
    if (confirm("患者【" + customerName + "】已经开始治疗?")) {
        $.ajax({
            url: Feng.ctxPath + "/doctorLooked/startTreatment",
            type: "post",
            data: {
                customerId: customerId
            },
            success: function (data) {
                Feng.success('操作成功!');
                DoctorLooked.search();
            },
            error: function (data) {
                alert('没有权限，请联系管理员!');
            }
        });
    }
};

DoctorLooked.receiveTreatment = function (id) {//点击转诊 客户ID
    var index = layer.open({
        type: 2,
        title: '接诊',
        area: ['60%', '70%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/receiveTreatment/' + id
    });
    this.layerIndex = index;
};

DoctorLooked.charge = function (id) {//点击划扣 客户ID
    var index = layer.open({
        type: 2,
        title: '收费',
        area: ['100%', '100%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/charge_info/' + id
    });
    this.layerIndex = index;
};

DoctorLooked.revisit = function (id) {//点击随访 客户ID
    var index = layer.open({
        type: 2,
        title: '随访',
        area: ['100%', '100%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/revisit_info/' + id
    });
    this.layerIndex = index;
};

DoctorLooked.subsequent = function (id) {//点击复诊预约 客户ID
    var index = layer.open({
        type: 2,
        title: '复诊预约',
        area: ['70%', '95%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/subsequent_info/' + id + '/2',
    });
    this.layerIndex = index;
};

DoctorLooked.image = function (id) {//点击影像 客户ID
    var index = layer.open({
        type: 2,
        title: '影像',
        area: ['100%', '100%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/image_info/' + id
    });
    this.layerIndex = index;
};

DoctorLooked.completion = function (customerId, customerName) {// 点击治疗完成 客户ID
    if (confirm("患者【" + customerName + "】已经开始治疗?")) {
        $.ajax({
            url: Feng.ctxPath + "/doctorLooked/completionTreatment",
            type: "post",
            data: {
                customerId: customerId
            },
            success: function (data) {
                Feng.success('操作成功!');
                DoctorLooked.search();
            },
            error: function (data) {
                alert('没有权限，请联系管理员!');
            }
        });
    }
};

DoctorLooked.imported = function (id) {
    var index = layer.open({
        type: 2,
        title: '再诊',
        area: ['50%', '60%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/case_import'
    });
    this.layerIndex = index;
};

DoctorLooked.zaizhen = function (id,reservationsId) {// 点击转诊 客户ID
    var idinfo = {};
    idinfo['id'] = id;
    idinfo['reservationsId'] = reservationsId;
    var index = layer.open({
        type: 2,
        title: '转诊',
        area: ['50%', '60%'],//宽高
        fix: true,//不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/zai_zhen/' + idinfo
    });
    this.layerIndex = index;
};

DoctorLooked.check = function () {// 检查是否选中
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if (selected.length == 0) {
        Feng.info("请先选中表格中的某一记录！");
        return false;
    } else {
        DoctorLooked.seItem = selected[0];
        return true;
    }
};

DoctorLooked.search = function () {
    DoctorLooked.table.refresh({query: DoctorLooked.formParams()});
    DoctorLooked.total();
};

DoctorLooked.resetSearch = function () {// 重置
    $("#doctorInputPublic", parent.document).val("");
    $("#customerSex").val("");
    $("#customerAgeStart").val("");
    $("#customerAgeEnd").val("");
    $("#doctor").val("");
    $("#startTime").val("");
    DoctorLooked.search();
};

DoctorLooked.close = function () {
    parent.layer.close(parent.layer.getFrameIndex(window.name));
};

DoctorLooked.total = function () {//人数统计
    var param1 = $("#startTime").val();  //预约到店时间
    var customerSex = $("#customerSex").val();
    var doctor = $("#doctor").val();
    var customerAgeStart = $("#customerAgeStart").val();
    var customerAgeEnd = $("#customerAgeEnd").val();
    var reach = $("#doctorInputPublic", parent.document).val();
    $.ajax({
        type: "GET",
        url: Feng.ctxPath + "/doctorLooked/total",
        data: {
            param1: param1,
            customerSex: customerSex,
            customerAgeStart: customerAgeStart, customerAgeEnd: customerAgeEnd, doctor: doctor
        },
        dataType: "json",
        success: function (data) {
            $("#all").html(data[0].countNum);// 今日新建预约
            $("#non-arrival").html(data[1].countNum);//今日书写病历
            $("#yi-arrived").html(data[2].countNum);// 今日随访人数
        }
    });
};

DoctorLooked.formParams = function () {//查询表单提交参数对象 @returns {{}}
    var queryData = {};
    queryData['reach'] = $("#doctorInputPublic", parent.document).val();
    queryData['startTime'] = $("#startTime").val();
    queryData['doctor'] = $("#doctor").val();
    queryData['customerSex'] = $("#customerSex").val();
    queryData['customerAgeStart'] = $("#customerAgeStart").val();
    queryData['customerAgeEnd'] = $("#customerAgeEnd").val();
    return queryData;
};

$("#doctorSearchAll", parent.document).click(function () {//主页搜索
    DoctorLooked.search();
});

DoctorLooked.getDoctor = function () {//初始化请求医生集合遍历
    $.ajax({
        url: Feng.ctxPath + "/consultant/getDoctor",
        type: "get",
        success: function (data) {
            var txt = '<option value="">--请选择医生--</option>';
            for (var i = 0; i < data.length; i++) {
                txt += '<option value="' + data[i].doctor + '">' + data[i].doctor + '</option>';
            }
            document.getElementById('doctor').innerHTML = txt;
            var seleteDoctorValue = $('#doctorValue').val();
            if (seleteDoctorValue != "") {
                $("#doctor option[value=" + seleteDoctorValue + "]").attr("selected", "selected");
            }
            DoctorLooked.search();
        },
        error: function (data) {
            alert('没有权限，请联系管理员!');
            return 0;
        }
    });
};

DoctorLooked.menuName = function () {//初始化请求表格筛选
    var menuName = $("#menuName").val();
    $.ajax({
        url: Feng.ctxPath + "/reservation/reservation_initialization",
        type: "post",
        data: {
            "menuName": menuName
        },
        success: function (data) {
            if (data != "") {
                var item = data.listx1.split("，");
                for (var i = 0; i < item.length; i++) {
                    $('#DoctorLookedTable').bootstrapTable('hideColumn', item[i]);
                }
            }
        }
    });
};

DoctorLooked.time = function () {//初始化赋值时间
    var time = new Date();
    var month = time.getMonth() + 1;
    var day = time.getDate();
    if (month < 10) {
        month = "0" + month
    }
    if (day < 10) {
        day = "0" + day
    }
    $("#startTime").val(time.getFullYear() + "-" + month + "-" + day);
};

DoctorLooked.timeChange = function (obj) {//时间前后切换
    var time = $("#startTime").val();
    var date = new Date(time);
    if (obj == '+') {
        date.setDate(date.getDate() + 1);
    } else {
        date.setDate(date.getDate() - 1);
    }
    var month = date.getMonth() + 1;
    var day = date.getDate();
    if (month < 10) {
        month = "0" + month
    }
    if (day < 10) {
        day = "0" + day
    }
    $("#startTime").val(date.getFullYear() + "-" + month + "-" + day);
    DoctorLooked.search();
};

$(function () {
    DoctorLooked.time();
    var defaultColunms = DoctorLooked.initColumn();
    var table = new BSTable(DoctorLooked.id, "/doctorLooked/list", defaultColunms);
    table.setPaginationType("server");
    table.setQueryParams(DoctorLooked.formParams());
    DoctorLooked.table = table.init();
    DoctorLooked.getDoctor();
    DoctorLooked.menuName();
    checkDate = function () {DoctorLooked.search();};
    $(document).on('click', '#laydate_clear,#laydate_today,#laydate_ok', function () {DoctorLooked.search();});
});